<!DOCTYPE html>
<html lang="en">
<head>
[#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/user.css?v=2" rel="stylesheet" type="text/css"/>
    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>
    <style type="text/css">
        option {
            font-size: 14px;
            line-height: 20px;
        }
    </style>

[#import "/customer/include/pagination.ftl" as p/]
</head>

<body>
<!--头部-->
[#include "/customer/include/header.ftl"]


<div class="member">
    <!--左边-->
[#include "/customer/include/member_left_menu.ftl"]

    <!--左边 end-->
    <div class="memberRight">
        <div class="member_tab">
            <div class="member_tab">
                <a  href="${path}/member/auth">实名认证</a>
                <a   href="${path}/member/auth/mobile">手机认证</a>
                <a class="on"  href="${path}/member/auth/email">邮箱认证</a>

                <a  href="${path}/member/auth/vip">VIP认证</a>
            </div>
        </div>
        <form class="layui-form">
            <div class="member_tab_info card0">
                <table class="layui-table">
                    <tbody>
                    <tr>
                        <td>邮箱地址：</td>
                        <td>
                            <input class="layui-input" lay-verify="required" type="text" name="email" id="email" maxlength="20"
                                   value="${(loginUser.email)!''}" " >
                        </td>
                    </tr>
                    </tbody>

                </table>
                <div class="layui-form-item">
                    <div class="layui-input-block">

                        <button lay-submit lay-filter="MainForm" class="layui-btn" style="width: 100px;background-color: #f3485a">
                            发送邮件
                        </button>
                    </div>
                </div>
            </div>

        </form>
        <div class="member_tab_info card1" style="display: none">
            <table class="layui-table">
                <tbody>
                <tr>
                    <td>请输入验证码：</td>
                    <td>
                        <input class="layui-input" lay-verify="required" type="text" name="randCode" id="randCode" maxlength="20">
                    </td>
                </tr>
                </tbody>

            </table>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button lay-submit  class="layui-btn btn1" style="width: 280px;margin-top:3px;background-color: #f3485a">
                        确认提交
                    </button>

                </div>
            </div>
        </div>

</div>
</div>


[#include "/customer/include/footer.ftl"]

<script type="text/javascript">
    $(function () {
        $('body').attr('style','min-width:500px');

    });
    $(".btn1").click(function(){
        var randCode =  $('#randCode').val();
        var email =  $('#email').val();
        ajax({
            url: "${path}/member/auth/ac",
            data: {
                'randCode':randCode ,
                'email':email
            },
            dataType:'json',
            success: function (result) {
                layui.layer.msg(result.content);
            },
            complete: function () {

            }
        });

    });

    layui.use('form', function () {
        var form = layui.form(), $ = layui.jquery, layer = layui.layer;
        form.on('submit(MainForm)', function (data) {
            var index = layer.load();
            ajax({
                url: "${path}/member/auth/emailAuth",
                data: data.field,
                dataType:'json',
                success: function (result) {
                    layer.close(index);

                    $('.card0').hide();
                    $('.card1').show();

                },
                complete: function () {
                    layer.close(index);
                },error:function(){
                    layer.close(index);
                }

            });
            return false;
        });
    });
</script>

</body>
</html>
